﻿using System.Web;
using System.Web.UI.HtmlControls;
using Cms.Web.Framework.Infrastructure;

namespace Cms.Web.Framework.Controls
{
    public class Form : HtmlForm
    {
        private readonly RequestDetails _details;

        public Form()
        {
            _details = (RequestDetails)HttpContext.Current.Items["RequestDetails"];
            Action = _details.RequestedUrl;
        }

        protected override void AddParsedSubObject(object obj)
        {
            if (obj is Content)
                _details.ContentPlaceHolders.Add((Content)obj);
            base.AddParsedSubObject(obj);
        }
    }
}